from moviepy.editor import VideoFileClip


def convert_avi_to_mp4(input_path, output_path):
    # 读取视频
    clip = VideoFileClip(input_path)
    # 写出为mp4格式
    clip.write_videofile(output_path, codec="libx264", audio_codec="aac")


if __name__ == "__main__":
    convert_avi_to_mp4(r"F:\project\temp\predict_3\3.avi", r"F:\project\temp\predict_3\3_output.mp4")
